<?php

namespace App\Models;

use App\Models\User;

class Like extends Model
{
    const LIKE_TYPE_NORMAL = 1;
    const LIKE_TYPE_HAD_APPOINTED = 2;

    protected $fillable = ['uid', 'target_type', 'target_id', 'like_type'];

    public function user()
    {
        return $this->belongsTo(User::class, 'uid');
    }

    public function target()
    {
        return $this->morphTo();
    }

}
